<template>
  <!-- 表格 -->
  <el-table :data="feedbackContent" style="width: 100%" border>
    <el-table-column label="序号" v-slot="{ $index }" fixed="left" align="center">
      {{ getSerialNumber($index) }}
    </el-table-column>
    <el-table-column property="feedbackId" label="反馈编号" align="center">
    </el-table-column>
    <el-table-column property="feedbackPerson" label="反馈人" align="center">
    </el-table-column>
    <el-table-column property="phoneNumber" label="反馈电话" align="center" width="110">
    </el-table-column>
    <el-table-column property="feedbackType" label="反馈类型" align="center" width="100">
    </el-table-column>
    <el-table-column property="feedbackContent" label="反馈内容" align="center">
    </el-table-column>
    <el-table-column property="feedbackImage" label="反馈相关图片" align="center" width="100">
      <template #default="scope">
        <img :src="scope.row.feedbackImage" alt="Image" style="width: 80px; height: 80px;" />
      </template>
    </el-table-column>
    <el-table-column property="dealStatus" label="处理状态" align="center">
    </el-table-column>
    <el-table-column v-if="title === '反馈列表'" property="handlerId" label="处理人Id" align="center">
    </el-table-column>
    <el-table-column v-if="title === '反馈列表'" property="handlingResult" label="处理结果" align="center">
    </el-table-column>
    <el-table-column property="remark" label="备注" align="center">
    </el-table-column>
    <el-table-column v-if="title === '反馈列表'" property="handlingTime" label="处理时间" align="center" width="100">
    </el-table-column>
    <el-table-column property="createTime" label="创建时间" align="center" width="100">
    </el-table-column>
    <el-table-column v-if="title === '反馈待处理'" label="操作" align="center" fixed="right">
      <template slot-scope="scope">
        <el-button type="primary" size="mini" @click="handleDeal(scope.$index, scope.row)">处理</el-button>
      </template>
    </el-table-column>
  </el-table>
</template>
<script>

export default {
  name: "FeedBackTable",
  props: {
    title: {
      type: String,
      require: true
    },
    feedbackContent: {
      type: Array,
      require: true
    },
    queryParams: {
      type: Object,
      require: true
    }
  },
  data() {
    return {
    }
  },
  methods: {
    // 点击处理按钮操作
    handleDeal(index, row) {
      console.log(index, row)
    },
    getSerialNumber(index) {
      return (this.queryParams.pageNum - 1) * this.queryParams.pageSize + index + 1;
    },
  }
}
</script>
<style lang="scss" scoped></style>